﻿<Window x:Class="VirtualRouterClient.DeviceIconPicker"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:VirtualRouterClient"
    Title="Choose Icon" Height="265.004" Width="393" ShowInTaskbar="False" ResizeMode="NoResize" Icon="/VirtualRouterClient;component/Icons/VirtualRouterEnabled.ico" WindowStartupLocation="CenterOwner">
    <Window.Resources>

        <local:ResourceToImageSourceConverter x:Key="ResourceToImageSourceConverter"></local:ResourceToImageSourceConverter>
       
    </Window.Resources>
    <Grid>
        <Label Height="40" Name="label1" VerticalAlignment="Top" FontSize="25" FontWeight="Bold" Margin="0,-7.69,0,0">Choose Icon</Label>
        <Label Height="28" Margin="12,20.763,8,0" Name="lblInstructions" VerticalAlignment="Top">Choose the icon to display for this device.</Label>
        
        <Rectangle Name="windowContent" Margin="0,45.371,0,46" Fill="White" />
        
        <ListView Margin="0,45.371,0,46" Name="listIcons" MouseDoubleClick="listIcons_MouseDoubleClick">
            <ListView.View>
                <local:TileView></local:TileView>
            </ListView.View>
            <ListView.ItemTemplate>
                <DataTemplate>
                    <StackPanel VerticalAlignment="Top">
                        <Image Width="48" Height="48"  Source="{Binding Path=IconPath, Converter={StaticResource ResourceToImageSourceConverter}}"></Image>
                        <TextBlock TextWrapping="Wrap" HorizontalAlignment="Center"  Text="{Binding Path=IconName}" ></TextBlock>
                    </StackPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        
        <Button Height="37" Margin="0,0,89,4" Name="btnOK" VerticalAlignment="Bottom" Click="btnOK_Click" HorizontalAlignment="Right" Width="75">_Save</Button>
        <Button Height="37" HorizontalAlignment="Right" Margin="0,0,8,4" Name="btnCancel" VerticalAlignment="Bottom" Width="75" IsCancel="True" IsDefault="True">_Cancel</Button>
    </Grid>
</Window>
